﻿package com.wandian.controller
{
	import com.wandian.data.GameData;
	import com.wandian.model.AccountProxy;
	import com.wandian.model.RoomInfoProxy;
	import com.wandian.model.UserInfoProxy;
	import com.wandian.model.vo.PlayerVo;
	import com.wandian.model.vo.RoomVo;
	import com.wandian.view.mediator.FriendAndRoomPlayerMediator;
	import com.wandian.view.mediator.GameRoomMediator;
	import com.wandian.view.mediator.HeadUploadMediator;
	import com.wandian.view.mediator.MaskGameMediator;
	import com.wandian.view.mediator.SelectPersonMediator;
	import com.wandian.view.mediator.account.AccountMediator;
	
	import flash.display.MovieClip;
	
	import org.puremvc.as3.interfaces.*;
	import org.puremvc.as3.patterns.command.*;

    public class SelectPersonCommand extends SimpleCommand
    {
        private var _global:GameData;
        private var _mcPanel:MovieClip;

        public function SelectPersonCommand()
        {
            this._global = GameData.getInstance();
            return;
        }

        override public function execute(notification:INotification) : void
        {
            super.execute(notification);
            var _loc_2:* = facade.retrieveProxy(UserInfoProxy.NAME) as UserInfoProxy;
            switch(notification.getName())
            {
                case CLZNoticeName.SHOW_SELECTED_PERSON:
                {
                    if (!this._mcPanel)
                    {
                        this._mcPanel = GameData.getMovieClip("SelectPersonPanel");
                    }
                    if (!Texas.I._mcWindosView.contains(this._mcPanel))
                    {
                        Texas.I._mcWindosView.addChildTo(this._mcPanel);
                        Texas.I._mcWindosView.centerXY(this._mcPanel);
                    }
                    facade.registerMediator(new SelectPersonMediator(this._mcPanel));
                    break;
                }
					//上传头像
				case CLZNoticeName.SHOW_UPLOADHEADER_PANEL:
				{
					if (!this._mcPanel)
					{
						this._mcPanel = GameData.getMovieClip("WindowsPanel");
					}
					if (!Texas.I._mcWindosView.contains(this._mcPanel))
					{
						Texas.I._mcWindosView.addChildTo(this._mcPanel);
						Texas.I._mcWindosView.centerXY(this._mcPanel);
					}
					facade.registerMediator(new HeadUploadMediator(this._mcPanel));
					break;
				}
                default:
                {
                    break;
                }
            }
            return;
        }

    }
}
